import 'package:oramemo/generated/json/base/json_convert_content.dart';
import 'package:oramemo/entity/membr_level_entity.dart';

MembrLevelEntity $MembrLevelEntityFromJson(Map<String, dynamic> json) {
  final MembrLevelEntity membrLevelEntity = MembrLevelEntity();
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    membrLevelEntity.msg = msg;
  }
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    membrLevelEntity.code = code;
  }
  final List<MembrLevelData>? data = (json['data'] as List<dynamic>?)
      ?.map(
          (e) => jsonConvert.convert<MembrLevelData>(e) as MembrLevelData)
      .toList();
  if (data != null) {
    membrLevelEntity.data = data;
  }
  return membrLevelEntity;
}

Map<String, dynamic> $MembrLevelEntityToJson(MembrLevelEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['msg'] = entity.msg;
  data['code'] = entity.code;
  data['data'] = entity.data?.map((v) => v.toJson()).toList();
  return data;
}

extension MembrLevelEntityExtension on MembrLevelEntity {
  MembrLevelEntity copyWith({
    String? msg,
    int? code,
    List<MembrLevelData>? data,
  }) {
    return MembrLevelEntity()
      ..msg = msg ?? this.msg
      ..code = code ?? this.code
      ..data = data ?? this.data;
  }
}

MembrLevelData $MembrLevelDataFromJson(Map<String, dynamic> json) {
  final MembrLevelData membrLevelData = MembrLevelData();
  final MembrLevelDataParams? params = jsonConvert.convert<
      MembrLevelDataParams>(json['params']);
  if (params != null) {
    membrLevelData.params = params;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    membrLevelData.id = id;
  }
  final double? levelFee = jsonConvert.convert<double>(json['levelFee']);
  if (levelFee != null) {
    membrLevelData.levelFee = levelFee;
  }
  final String? currency = jsonConvert.convert<String>(json['currency']);
  if (currency != null) {
    membrLevelData.currency = currency;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    membrLevelData.status = status;
  }
  final int? memberTime = jsonConvert.convert<int>(json['memberTime']);
  if (memberTime != null) {
    membrLevelData.memberTime = memberTime;
  }
  final int? orderBy = jsonConvert.convert<int>(json['orderBy']);
  if (orderBy != null) {
    membrLevelData.orderBy = orderBy;
  }
  final MembrLevelDataMemberLevelDesc? memberLevelDesc = jsonConvert.convert<
      MembrLevelDataMemberLevelDesc>(json['memberLevelDesc']);
  if (memberLevelDesc != null) {
    membrLevelData.memberLevelDesc = memberLevelDesc;
  }
  return membrLevelData;
}

Map<String, dynamic> $MembrLevelDataToJson(MembrLevelData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['params'] = entity.params?.toJson();
  data['id'] = entity.id;
  data['levelFee'] = entity.levelFee;
  data['currency'] = entity.currency;
  data['status'] = entity.status;
  data['memberTime'] = entity.memberTime;
  data['orderBy'] = entity.orderBy;
  data['memberLevelDesc'] = entity.memberLevelDesc?.toJson();
  return data;
}

extension MembrLevelDataExtension on MembrLevelData {
  MembrLevelData copyWith({
    MembrLevelDataParams? params,
    int? id,
    double? levelFee,
    String? currency,
    int? status,
    int? memberTime,
    int? orderBy,
    MembrLevelDataMemberLevelDesc? memberLevelDesc,
  }) {
    return MembrLevelData()
      ..params = params ?? this.params
      ..id = id ?? this.id
      ..levelFee = levelFee ?? this.levelFee
      ..currency = currency ?? this.currency
      ..status = status ?? this.status
      ..memberTime = memberTime ?? this.memberTime
      ..orderBy = orderBy ?? this.orderBy
      ..memberLevelDesc = memberLevelDesc ?? this.memberLevelDesc;
  }
}

MembrLevelDataParams $MembrLevelDataParamsFromJson(Map<String, dynamic> json) {
  final MembrLevelDataParams membrLevelDataParams = MembrLevelDataParams();
  return membrLevelDataParams;
}

Map<String, dynamic> $MembrLevelDataParamsToJson(MembrLevelDataParams entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  return data;
}

extension MembrLevelDataParamsExtension on MembrLevelDataParams {
}

MembrLevelDataMemberLevelDesc $MembrLevelDataMemberLevelDescFromJson(
    Map<String, dynamic> json) {
  final MembrLevelDataMemberLevelDesc membrLevelDataMemberLevelDesc = MembrLevelDataMemberLevelDesc();
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    membrLevelDataMemberLevelDesc.remark = remark;
  }
  final MembrLevelDataMemberLevelDescParams? params = jsonConvert.convert<
      MembrLevelDataMemberLevelDescParams>(json['params']);
  if (params != null) {
    membrLevelDataMemberLevelDesc.params = params;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    membrLevelDataMemberLevelDesc.id = id;
  }
  final int? memberLevelId = jsonConvert.convert<int>(json['memberLevelId']);
  if (memberLevelId != null) {
    membrLevelDataMemberLevelDesc.memberLevelId = memberLevelId;
  }
  final String? levelName = jsonConvert.convert<String>(json['levelName']);
  if (levelName != null) {
    membrLevelDataMemberLevelDesc.levelName = levelName;
  }
  final String? levelTitle = jsonConvert.convert<String>(json['levelTitle']);
  if (levelTitle != null) {
    membrLevelDataMemberLevelDesc.levelTitle = levelTitle;
  }
  final String? language = jsonConvert.convert<String>(json['language']);
  if (language != null) {
    membrLevelDataMemberLevelDesc.language = language;
  }
  return membrLevelDataMemberLevelDesc;
}

Map<String, dynamic> $MembrLevelDataMemberLevelDescToJson(
    MembrLevelDataMemberLevelDesc entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['remark'] = entity.remark;
  data['params'] = entity.params?.toJson();
  data['id'] = entity.id;
  data['memberLevelId'] = entity.memberLevelId;
  data['levelName'] = entity.levelName;
  data['levelTitle'] = entity.levelTitle;
  data['language'] = entity.language;
  return data;
}

extension MembrLevelDataMemberLevelDescExtension on MembrLevelDataMemberLevelDesc {
  MembrLevelDataMemberLevelDesc copyWith({
    String? remark,
    MembrLevelDataMemberLevelDescParams? params,
    int? id,
    int? memberLevelId,
    String? levelName,
    String? levelTitle,
    String? language,
  }) {
    return MembrLevelDataMemberLevelDesc()
      ..remark = remark ?? this.remark
      ..params = params ?? this.params
      ..id = id ?? this.id
      ..memberLevelId = memberLevelId ?? this.memberLevelId
      ..levelName = levelName ?? this.levelName
      ..levelTitle = levelTitle ?? this.levelTitle
      ..language = language ?? this.language;
  }
}

MembrLevelDataMemberLevelDescParams $MembrLevelDataMemberLevelDescParamsFromJson(
    Map<String, dynamic> json) {
  final MembrLevelDataMemberLevelDescParams membrLevelDataMemberLevelDescParams = MembrLevelDataMemberLevelDescParams();
  return membrLevelDataMemberLevelDescParams;
}

Map<String, dynamic> $MembrLevelDataMemberLevelDescParamsToJson(
    MembrLevelDataMemberLevelDescParams entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  return data;
}

extension MembrLevelDataMemberLevelDescParamsExtension on MembrLevelDataMemberLevelDescParams {
}